﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using WindowsGame1.SpriteClasses;

namespace WindowsGame1.ItemClasses
{
    public class Satellite
    {
        static Random random = new Random();
        ItemSprite sprite;
        static float collisionRadius = 64;
        int goldMaximum;
        int goldMinimum;
        int gold;
        List<BaseItem> items;

        public Satellite(Game game,Texture2D texture,Vector2 position,List<BaseItem> items)
        {
            sprite = new ItemSprite(game, texture, position);
            gold = 0;
            this.items = items;
        }

        public Satellite(Game game,Texture2D texture,Vector2 position,int goldMinimum,int goldMaximum, List<BaseItem> items)
        {
            sprite = new ItemSprite(game, texture, position);
            this.goldMinimum = goldMinimum;
            this.goldMaximum = goldMaximum;
            if (goldMinimum == goldMaximum)
                gold = goldMinimum;
            else
                gold = Satellite.random.Next(goldMinimum, goldMaximum + 1);
            this.items = items;
        }

        public static float CollisionRadius
        {
            get { return collisionRadius; }
        }

        public Vector2 Position
        {
            get { return sprite.Position; }
        }

        public Vector2 Origin
        {
            get { return sprite.Origin; }
        }

        public int Gold
        {
            get { return gold; }
        }

        public List<BaseItem> Items
        {
            get { return items; }
        }

        public void Update(GameTime gameTime)
        {
            sprite.Update(gameTime);
        }

        public void Draw(GameTime gameTime)
        {
            sprite.Draw(gameTime);
        }
    }
}
